#ifndef _FILENAME_CACHE_H_
#define _FILENAME_CACHE_H_
#include <pthread.h>
#include <sys/types.h>
#include "htable.h"
#include "list.h"
#include "url_info.h"

struct filename_cache
{
	unsigned int num;
	struct htable htable;
	struct list_head newly;
	pthread_mutex_t lock;
	unsigned int mava; /* M */
	pthread_t t;
};

/* 1 for look up success, 0 for look up fail */
int fcache_find(struct filename_cache *fc, struct url_info *url, u_int32_t *ip);

/* 1 for success, -1 for fail */
int fcache_add(struct filename_cache *fc, struct url_info *url, u_int32_t ip);

/* 1 for look up success, 0 for look up fail */
int fcache_update(struct filename_cache *fc, struct url_info *url, u_int32_t ip);
#endif
